package com.ocom.srvpaccess.controller;


import com.ocom.common.constant.SrvpAccessDeviceUrl;
import com.ocom.common.enums.ResultEnum;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.srvpaccess.service.MjDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MachController {

	@Autowired
	MjDeviceInfoService mjDeviceInfoService;

	@PostMapping(SrvpAccessDeviceUrl.URLP_getCenterMachByCompanyId)
	public Result getCenterMachByCompanyId(Long companyId){
		List<String> list= mjDeviceInfoService.getCenterMachByCompanyId(companyId);
		if(list==null || list.size()==0){
			return ResultUtil.error(ResultEnum.Err_2022);
		}else{
			return ResultUtil.success(list);
		}
	}

}
